<?php
class Somi_Form_Such extends Zend_Dojo_Form
{
	public function init()
	{
		
		$this->setName('Auftrag');
		$this->setAction($this->getView()->url())->setMethod('post');
		#$this->addAttribs(array('onSubmit'=>'return validate(this)'));
		
    	
    	
		$formDecorators=array(
            'FormElements',
        array('HtmlTag',array('tag'=>'dl','class'=>'zend_form')),
            'DijitForm', // hier stand bei dir vorher: 'Form',
        );
                
        
        $elementDecorators=array(
        'DijitElement', // vorher: 'ViewHelper',
        'Errors',
        array(array('data'=>'HtmlTag'),array('tag'=>'div','class'=>'element')),
        array('Label',array('class'=>'left','requiredSuffix' => '*')),
        array(array('row'=>'HtmlTag'),array('tag'=>'div','class'=>'row')),
        );
        
        $buttonDecorators=array(
        'DijitElement', // vorher: 'ViewHelper',
        array(array('data'=>'HtmlTag'),array('tag'=>'div','class'=>'button')),
        array(array('row'=>'HtmlTag'),array('tag'=>'div'))
        );  
		
	
		$filterToLower = new Zend_Filter_StringToLower();
        $filterToLower->setEncoding('UTF-8');
		
        #Suche
        $suche=$this->createElement('ValidationTextBox','suche',array(
        'label'			=> '',
        'alnum'			=>true,
        #'required'		=> true,
        'PromptMessage'		=> '<div style="width:200px">Geben Sie bitte hier Ihren Suchbegriff ein</div>', 
        'style'			=> 'width:245px;', 
        #'filters'		=> array($filterToLower,),
        'validators'	=> array('NotEmpty',),
        #'value'			=> 'Suche',
        #'onfocus'		=>  "if(this.value=='Suche'){this.value='';}",
        #'onblur'		=> "if(this.value==''){this.value='Begriff eingeben';}",
        'propercase' => true,
        'trim'       => true,
        'style'			=> 'width:350px;height:20px;font-size:16px;background:url(/sms/public/images/lupe.png) no-repeat right;background:url(/public/images/lupe.png) no-repeat right;',
        ));
        
        $auftrag_nr=new Zend_Form_Element_Text('auftrag_nr');
		$auftrag_nr->setOptions(array(
	                            'filters'        => array('StringTrim'),
	                            'dojoType'       => array('dijit.form.ComboBox'),
	                            'store'          => 'inStore',
	                			'searchAttr' => 'auftrag_nr',
	                            'autoComplete'   => 'false',
	                            'hasDownArrow'   => 'true',
	                            'label' => '',
								'PromptMessage'		=> '<div style="width:200px">Suchen Sie nach Ihre Auftrag.</div>',
								'style'	=> 'width:400px;height:25px;font-size:18px;',
	                    ));
	                    

        
        $submit=$this->createElement('SubmitButton','submit',array(
        'label'			=> 'Suche',
        #'style'			=> 'width:200px;height:25px;',
        ));
        
        
         $this->addElements(array($suche));     
        
	}
}